<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>学员课程管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/cms/userCourse/">学员课程列表</a></li>
		<shiro:hasPermission name="cms:userCourse:edit"><li><a href="<c:url value='${fns:getAdminPath()}/cms/userCourse/form?id=${userCourse.id}&courseId=${userCourse.courseId}'>
		<c:param name='userCourse.courseName' value='${userCourse.courseName}'/></c:url>">学员课程添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="userCourse" action="${ctx}/cms/userCourse/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
        <div>
            <label>用户归类：</label>
            <form:select id="remarks" path="remarks" class="input-medium">
                <form:option value="" label="-- 全部 --"/>
                <form:options items="${fns:getDictList('course_category_name')}" itemLabel="label" itemValue="value" htmlEscape="false"/></form:select>
            <label>手用户ID：</label><input id="id" name="id" type="text" maxlength="50" class="input-mini" value="${userCourse.id}"/>
        </div><div style="margin-top:8px;">
        <label>日期范围：&nbsp;</label><input id="beginDate" name="beginDate" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
                                         value="<fmt:formatDate value="${userCourse.beginDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
        <label>&nbsp;--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><input id="endDate" name="endDate" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
                                                                    value="<fmt:formatDate value="${userCourse.endDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
        &nbsp;&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>&nbsp;&nbsp;
    </div>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
			    <th>手用户ID</th>
				<th>学员昵称</th>
                <th>学员归类</th>
                <th>注册时间</th>
                <th>课程ID</th>
				<th>课程名称</th>
				<th>必修/选修</th>
				<shiro:hasPermission name="cms:userCourse:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="userCourse">
			<tr>
                <td>${userCourse.id}</td>
				<td>${userCourse.name}</td>
                <td>${userCourse.remarks}</td>
				<td>
					<fmt:formatDate value="${userCourse.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
                <td>${userCourse.courseId}</td>
				<td>
					${userCourse.courseName}
				</td>
                <td>${fns:getDictLabel(userCourse.courseType, 'course_type', '选修')}</td>
				<shiro:hasPermission name="cms:userCourse:edit"><td>
    				<a href="${ctx}/cms/userCourse/form?id=${userCourse.id}&courseId=${userCourse.courseId}">修改</a>
					<a href="${ctx}/cms/userCourse/delete?id=${userCourse.id}&courseId=${userCourse.courseId}" onclick="return confirmx('确认要删除该课程吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>